<?php date_default_timezone_set("Australia/Melbourne");
		$serverIp = "101.187.235.211";
		$domain = "approd9h4leb60v4olh1v.phonecollection.com.au";
		
		$token = array(
				'ADPC'=>'d7cc8f5f355e14e28cc7f6d991f8ab65',
				'BBPC'=>'828598b674ecce28e113886d86f9e6b2',
				'BHPC'=>'d436d4852b891d74aac40d4975017f6d',
				'BSPC'=>'6f611c770ea46299c69eb4638ddb4837',
				'BSIC'=>'490d51748adbad7046e47b899248ce1c',
				'CBPC'=>'57faeaafeb8aa437821138ab9d511e9a',
				'CLPC'=>'1f1d6e47e6b22b3e4b2ce7abaa6632f7',
				'WHPC'=>'b8859cbdf2d544bf330f180ce7198a81',
				'EPPC'=>'d406d0741074139dc37c9809527b82e5',
				'FGPC'=>'84ee9085ec133e7f78c7bb2965964271',
				'HPPC'=>'d93a5def7511da3d0f2d171d9c344e91',
				'KCPC'=>'5085dcb23daed4abf8ea7a3e4a4b8f3d',
				'NLPC'=>'858bf4c7fa2b78013c37e3ad573c8dc3',
				'PMPC'=>'efcdd4d6806e95fa77e322990aa45518',
				'SLIC'=>'1967ac469abd726eb6505c8896172843',
				'WBPC'=>'1b7db9365d158a99e00966e886efa44e',
				'WBIC'=>'5ebc2c3deb9af8f205b81471f3d0be95',
				'WLIC'=>'d9763570f56bfb26d6b21c8e674234bf',
				'WGIC'=>'bac7b718bd673a2507cc7dec038e9ac0',
				'WGPC'=>'84da7238be2e78d3cc504ec61754b3e8',
				'CLIC'=>'0d9ca92a8ad799cec6e7cddec6118047',
				'PMIC'=>'bd94887337fcb0d0973e02a88ddfdd41',
				'BSXP'=>'46f4092ecb356b3c2b8b3a3c60d31fb6',
				'FGIC'=>'062702a82cdbc22731e8b8fbface6e20',
				'HPIC'=>'27c0fd4434344f5348e5539eacb2e7cd',
				'EPIC'=>'N3pPOERmS3p6ZDRlY1pOS0dubXdTdz09',
				'CBIC'=>'62018c1ebc2fbe3c1f48208ec48ea8ba'
				
				);
		
		
		
		$TodayDate = date('Y-m-d', time());
		$startyear = '2015-01-05';
		$payrollCycle = 1;
		$currentWeekStart = '2015-01-05';
		$currentWeekEnd = '2015-01-18';
		$test = false;
		while($test == false){
			if($TodayDate >=$currentWeekStart && $TodayDate <= $currentWeekEnd){
				$finalCycle = $payrollCycle;
				$test = true;
			}else{
				$currentWeekStart = date('Y-m-d',strtotime('+14 day', strtotime($currentWeekStart)));
				$currentWeekEnd = date('Y-m-d',strtotime('+14 day', strtotime($currentWeekEnd)));
				$payrollCycle ++;
				$test = false;
			}
		}

$targetCycle = array(
			'0' => array('2015-01-05','2015-02-01'),
			'1' => array('2015-02-02','2015-03-01'),
			'2' => array('2015-03-02','2015-03-29'),
			'3' => array('2015-03-30','2015-04-26'),
			'4' => array('2015-04-27','2015-05-31'),
			'5' => array('2015-06-01','2015-06-28'),
			'6' => array('2015-06-29','2015-08-02'),
			'7' => array('2015-08-03','2015-08-30'),
			'8' => array('2015-08-31','2015-10-04'),
			'9' => array('2015-10-05','2015-11-01'),
			'10' => array('2015-11-02','2015-11-29'),
			'11' => array('2015-11-30','2015-12-31')
			);
foreach($targetCycle as $k => $v){
	if($TodayDate >= $v[0] && $TodayDate <= $v[1]){
		$cycleTarget = $k+1;	
		$currentTargetStart = $v[0];
		$currentTargetEnd = $v[1];
	}
}
?>